package com.fs.web.base.execption;

import com.fs.web.base.vo.JsonResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;

/**
 * @author ACE
 * @desc 自定义异常
 * @creationTime 2019-03-07 14:31
 * @projectName gps-root
 * @packageName com.fs.base.execption
 */
@RestControllerAdvice
public class CustomExtHandler {
    @ExceptionHandler(value = ExecptionData.class)
    Object handleException(ExecptionData e, HttpServletRequest request){
        return JsonResponse.error(e.getCodeEnum());
    }

}
